# -*- coding: UTF-8 -*-
# @Project ：luffycity 
# @File    ：回顾案例3：算法实现.py
# @Author  ：于金龙
# @IDE     ：PyCharm 
# @Date    ：2024/7/12 下午3:46
# TODO:找寻出列表中存储的最大值，且将其移动到列表的最后位置
alist = [2,8,61,7,6,5]
# max_num = max(alist)
# alist.append(max_num)
# alist.pop(alist.index(max_num))
# print(alist)
for i in range(len(alist) - 1):
    if alist[i] > alist[i+1]:
        alist[i],alist[i+1] = alist[i+1],alist[i]
    print(alist)
